﻿CREATE FUNCTION [QIC].[InterfaceFactory_] (@DelegateName varchar(50), @ConfigName varchar(50), @InterfaceId int)
RETURNS nvarchar(MAX)
AS
BEGIN

	IF @DelegateName='FN'
	BEGIN
		RETURN [QIC].[InterfaceFactory_FN] (@ConfigName, @InterfaceId)
	END
	IF @DelegateName='IF'
	BEGIN
		RETURN [QIC].[InterfaceFactory_IF] (@ConfigName, @InterfaceId)
	END
	IF @DelegateName='P'
	BEGIN
		RETURN [QIC].[InterfaceFactory_P] (@ConfigName, @InterfaceId)
	END
	IF @DelegateName='TF'
	BEGIN
		RETURN [QIC].[InterfaceFactory_TF] (@ConfigName, @InterfaceId)
	END
	IF @DelegateName='V'
	BEGIN
		RETURN [QIC].[InterfaceFactory_V] (@ConfigName, @InterfaceId)
	END
	--DEFAULT
	RETURN NULL

END